// components/home-display-bar/home-display-bar.js
const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    displayData: {
      type: Array,
      value: []
    },
    /**
     *  {
       "name": "补水保湿",
       "show": "2",
       "pic": "https://images.jiabao19.com/images/public/maintain/2023/10/18/ceb8871cbb254a71bf634377d1fb7d2ekbh1v8kg57.png",
       "id": 1599,
       "url": "/pages/activity/activityList?title=\"补水保湿\""
     },
     */
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    pushToCategory(e) {
      // let name = e.currentTarget.dataset.name;

      let url = e.currentTarget.dataset.url;
      let name = url.split('=')[1];
      app.globalData.categoryName = name;
      wx.switchTab({
        url: '/pages/activity/activityList',
      })
    },
  }
})
